package com.ctrip.cap.client.mail;

import com.ctrip.cap.client.impl.base.BaseClient;
import com.ctrip.cap.client.impl.base.BaseClientImpl.HttpMethodType;
import com.ctrip.cap.domain.LogRun;

public class WhiteBoardMailServiceClient extends BaseClient {
	private final static String BASE_PATH = "/mail/whiteboard/service";
	private final static String SEND_MAIL = "/sendMail";
	
	public WhiteBoardMailServiceClient() {
		baseUrl = "http://localhost:8080/cap-data-server";
	}
	
	public WhiteBoardMailServiceClient(String jenkinsServer) {
		baseUrl = jenkinsServer;
	}
	
	public int sendMail(LogRun logRun) {
		return this.baseCall(BASE_PATH+SEND_MAIL, logRun , HttpMethodType.POST, Integer.class);
	}
	
	public static void main(String[] args) {
		WhiteBoardMailServiceClient wbMailServiceClient = new WhiteBoardMailServiceClient();
		LogRun logRun = new LogRun();
		logRun.setAppId("9999");
		logRun.setProgress(1f);
		logRun.setRunId(11388);
		logRun.setRunType(0);
		wbMailServiceClient.sendMail(logRun);
	}
}
